﻿<UserControl x:Class="XWord.WPF.ApplicationFramework.TestModules.validationsimple.ValidationLifeCycleSimple"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:validations="http://schemas.xword.com/winfx/xaml/info"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <TabControl>
            <TabItem Header="ValidatorByPriority">
                <StackPanel>
                    <TextBox x:Name="Element_TextBox" HorizontalAlignment="Left" Width="100"></TextBox>
                    <validations:RequiredValidator Priority="1"
                           Property="{Binding Text,ElementName=Element_TextBox}"/>
                    <validations:StringLengthValidator Priority="0" InitializeValidate="True" MinimumLength="5" MaximumLength="10"
                           Property="{Binding Text,ElementName=Element_TextBox}"/>
                    <Button Content="Button" Height="23" Name="button1" Width="75" Click="button1_Click" />
                </StackPanel>
            </TabItem>
            <TabItem Header="InitializeValidate">
                <StackPanel>
                    
                    <TextBox x:Name="Element_StringLengthValidatorTextBox" HorizontalAlignment="Left" Text="xx" Width="100"></TextBox>
                    <validations:StringLengthValidator MinimumLength="5" MaximumLength="10" InitializeValidate="True"
                            x:Name="abc"
                           Property="{Binding Text,ElementName=Element_StringLengthValidatorTextBox}"/>
                    <Button Click="button1_Click">xxxx</Button>
                </StackPanel>
            </TabItem>
            <TabItem Header="GapValidate">
                <StackPanel>
                    <TextBox x:Name="Element_GapValidateTextBox" HorizontalAlignment="Left" Width="100"></TextBox>
                    <validations:StringLengthValidator MinimumLength="5" MaximumLength="10"
                            GapValidateSecond="0.2"
                           Property="{Binding Text,ElementName=Element_GapValidateTextBox}"/>
                    
                </StackPanel>
            </TabItem>
        </TabControl>
    </Grid>
</UserControl>
